package yki.paperplane.server.db.planeoperator;

import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import yki.paperplane.server.db.DBOperator;

public class ReplyTheSessionOperator extends DBOperator{
	
	int session_id;
	String message;
	Date replyDate;
	
	public ReplyTheSessionOperator( int letter_id, int sid, String msg, Date date ){
		session_id = sid;
		message = msg;
		replyDate = date;
	}

	@Override
	public Object execute(Connection connection) throws SQLException {
		PreparedStatement statement = connection.prepareStatement( SQL_REPLYPLANE);
		statement.setInt(1, session_id);
		statement.setString(2, message);
		statement.setDate(3, replyDate);
		return statement.executeUpdate();
	}

}
